package com.sky.service;

import com.sky.domain.WmsWareOrderTaskDetail;
import com.sky.domain.WmsWareSku;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sky.dto.SkuStockVO;
import com.sky.to.member.MemberReceiveAddressTo;
import com.sky.to.ware.StockTo;
import com.sky.utils.PageUtils;
import com.sky.vo.param.WareSkuVO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
* @author Administrator
* @description 针对表【wms_ware_sku(商品库存)】的数据库操作Service
* @createDate 2024-06-30 16:47:16
*/
public interface WmsWareSkuService extends IService<WmsWareSku> {

    /**
     * 分页查询
     * @param vo
     * @return
     */
    PageUtils pageQuery(WareSkuVO vo);

    /**
     * 获取sku库存
     *
     * @param skuIds
     * @return
     */
    List<SkuStockVO> getSkuStock(List<Long> skuIds);

    /**
     * 根据收货地址id计算运费
     **/
    MemberReceiveAddressTo getFreight(Long addrId) throws Exception;

    /**
     * 生成订单锁库存
     **/
    Boolean lockStock(StockTo stockTo);

    /**
     * 订单解锁库存
     **/
    void unLockStock(WmsWareOrderTaskDetail detail);

    /**
     * 订单扣减库存
     **/
    void deductionStock(WmsWareOrderTaskDetail detail);
}
